package com.zjcloud;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration;
import com.zjcloud.framework.config.MyBatisConfig;
import com.zjcloud.framework.config.AopConfig;
// import com.zjcloud.framework.config.SecurityConfig;
// import com.zjcloud.framework.config.TestConfig;

/**
 * 启动程序
 * 
 * @author ruoyi
 */
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, MybatisPlusAutoConfiguration.class, FlywayAutoConfiguration.class })
@ComponentScan(basePackages = {"com.zjcloud", "com.zjcloud.motr", "com.zjcloud.academic", "com.zjcloud.jwgl"})
@Import({MyBatisConfig.class, AopConfig.class})
@MapperScan(basePackages = {"com.zjcloud.**.mapper"})
@EnableTransactionManagement
public class RuoYiApplication
{
    public static void main(String[] args)
    {
        System.setProperty("spring.devtools.restart.enabled", "false");
        
        // 设置系统属性以确保正确的类加载
        System.setProperty("spring.profiles.active", "dev");
        System.out.println("Starting ZhijiaoCloud Application...");
        
        // 检查关键依赖是否可用
        try {
            Class.forName("org.springframework.security.web.AuthenticationEntryPoint");
            System.out.println("Spring Security Web dependency is available");
        } catch (ClassNotFoundException e) {
            System.err.println("Warning: Spring Security Web dependency not found in classpath: " + e.getMessage());
            System.err.println("Please ensure all required dependencies are included in the classpath.");
        }
        
        SpringApplication.run(RuoYiApplication.class, args);
        System.out.println("\n" +
                "                                                                                              \n" +
                " ___                                                                                          \n" +
                "    / /                                               //   ) )                                \n" +
                "   / /    / __     ( )     ( ) ( )  ___      ___     //        //  ___               ___   /  \n" +
                "  / /    //   ) ) / /     / / / / //   ) ) //   ) ) //        // //   ) ) //   / / //   ) /   \n" +
                " / /    //   / / / /     / / / / //   / / //   / / //        // //   / / //   / / //   / /    \n" +
                "/ /___ //   / / / / ((  / / / / ((___( ( ((___/ / ((____/ / // ((___/ / ((___( ( ((___/ /     \n" +
                "=========================================智教云（ZhijiaoCloud）=================================\n");
    }
}
